function ListNode(val) {
    this.val = val;
    this.next = null;
};
/**
 * @param {ListNode} node
 * @return {void} Do not return anything, modify node in-place instead.
 */
var deleteNode = function(node) {
    let newHead = head
    let pre = head
    while (pre.next != null) {
        if (pre.next.val == node.val) {
            pre.next = pre.next.next
        }
        pre = pre.next
    }
    return newHead

};
let head = new ListNode(4)
head.next = new ListNode(5)
head.next.next = new ListNode(1)
head.next.next.next = new ListNode(9)
console.log(deleteNode(new ListNode(5)))
